// 25-自定义网页标题

import axios from "axios";
import { use, useEffect, useState } from "react";

export function useTitle(title) {
    useEffect(() => {
        document.title = title
    }, [title])
}


export function useProList(limit) {

    const [pro, setPro] = useState([])

    useEffect(() => {
        axios.get('http://121.89.205.189:3000/api/pro/list?limit=' + limit)
            .then(res => {
                setPro(res.data.data)
            })
    }, [limit])

    return pro
}